class UsersController < AdminSupportController
  resources_controller_for :users
  
  def before_update(user, params)
    unless user.signup_complete?
      if params[:signup_complete]
        user.signup_was_completed = true
        host, port = request.host_with_port.split(":")
        user.post_signup_url = url_for(:controller => 'welcome', :host => host, :port => port || 80)
      end
    end
  end

  def impersonate
    self.impersonator = self.current_user
    self.current_user = find_resource
    redirect_to events_url
  end
  
  def stop_impersonating
    self.current_user = self.impersonator
    self.impersonator = nil
    redirect_to admin_users_url
  end
  
end
